package com.sdy.hospitalguard.embed.keepalive.init;

import com.sdy.hospitalguard.embed.keepalive.manager.netty.factory.NettyFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class StartNettyThread implements Runnable{

    /**
     * 宏定义
     */
    private Integer isKeepHttpConnectionPort;
    public void setIsKeepHttpConnectionPort(Integer isKeepHttpConnectionPort) {
        this.isKeepHttpConnectionPort = isKeepHttpConnectionPort;
    }

    @Override
    public void run() {
        try {
            new NettyFactory(isKeepHttpConnectionPort).createNetty(0);
        }catch (Exception e){
            log.error("[START_KEEP_HTTP_CONNECTION]", e);
        }
    }
}
